import request from '@/utils/request'

// 查询热销商品配置列表
export function listBestsellers(query) {
  return request({
    url: '/system/bestsellers/list',
    method: 'get',
    params: query
  })
}

// 查询热销商品配置详细
export function getBestsellers(bestsellersId) {
  return request({
    url: '/system/bestsellers/' + bestsellersId,
    method: 'get'
  })
}

// 新增热销商品配置
export function addBestsellers(data) {
  return request({
    url: '/system/bestsellers',
    method: 'post',
    data: data
  })
}

// 修改热销商品配置
export function updateBestsellers(data) {
  return request({
    url: '/system/bestsellers',
    method: 'put',
    data: data
  })
}

// 删除热销商品配置
export function delBestsellers(bestsellersId) {
  return request({
    url: '/system/bestsellers/' + bestsellersId,
    method: 'delete'
  })
}

export function listProducts() {
  return request({
    url: '/system/bestsellers/products',
    method: 'get'
  })
}

